var userData = _appConfigs.getUserData().userOrgs;
var streetName = userData.orgName;
var streetId = userData.orgId;
$('#laborStreetGrid').datagrid({ 
	url:'collect/management/getLaborStreetList', 
	queryParams:{
		streetName:userData.orgName,
		streetId:userData.orgId
    },
	rownumbers:true,
    fit:true,
    fitColumns:true,
    singleSelect:true,
    striped:true,

    columns:[[
              {field:'communityName', title:'社区名称', width:100, rowspan:3, align:'center'},
              {field:'laborNumInAge', title:'户籍劳动年龄<br/>内人口总数', width:90, rowspan:3, align:'center'},
              {title:'目前状况', colspan:8, align:'center'}, 
              {field:'employedRate', title:'就业率', width:85, rowspan:3, align:'center'},
              {field:'companyRate', title:'单位就业率', width:85, rowspan:3, align:'center'}
            ],[
              {title:'就业人员情况', colspan:5, align:'center'},
              {field:'unJobPeople', title:'无业求职人员', width:90, rowspan:2, align:'center'},    
              {field:'undesirePeople', title:'无就业愿望人员', width:90, rowspan:2, align:'center'},
              {field:'loseTouchPeople', title:'失联人员', width:85, rowspan:2,align:'center'}
            ],[
              {field:'subTotal', title:'小计', width:85, align:'center'},    
              {field:'company', title:'单位就业', width:85, align:'center'},
              {field:'flexibleEmployed', title:'灵活就业', width:85, align:'center'},    
              {field:'selfEmployed', title:'自主创业', width:85, align:'center'},
              {field:'individualOperation', title:'个体经营', width:85, align:'center'}
            ]]	
}); 

function laborCommunity(){
	var rowData = $('#laborStreetGrid').datagrid('getSelected');
	if(rowData == undefined){
		$.messager.alert('消息','请选择社区');
	}else{
		var isExists = window.mainpage.mainTabs.isExists('劳动力就业情况汇总表（社区）', 'collect/management/laborCollect_community_jump');
	    switch (isExists) {
	        case 0: 
	    	    window.mainpage.mainTabs.createTab('劳动力就业情况汇总表（社区）','collect/management/laborCollect_community_jump',
	    	        '', true, true, true, true, {name: 'bindData', params: rowData}); break;
	        case 1: 
	    	    window.mainpage.mainTabs.createTab('劳动力就业情况汇总表（社区）','collect/management/laborCollect_community_jump',
	    	        '', true, true, true, true, {name: 'bindData', params: rowData}); break;
	        case 2: 
	    	    window.mainpage.mainTabs.jumpTab('劳动力就业情况汇总表（社区）', {name: 'bindData', params: rowData}); break;
	        default: break;
	    }
	}
}

function exportLaborStreetList(){
	debugger;
	var street,community;
	if(userData.porgId == _appConfigs.appOrgId){  //街道
		street = userData.orgId;
		community = "";
	}else if(userData.porgId != _appConfigs.appOrgId && userData.orgName.indexOf('社区')>=0){ //社区
		street = "";
		community = userData.orgId;
	}else{  //全部
		street = "";
		community = "";
	}
	window.location.href ="collect/excel/exportLaborStreetCollect?streetName=" + "" + "&streetId=" + street;	
}
